<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkRadioButton</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="ButtonWidgets.html" title="按钮和开关">
<link rel="prev" href="gtk3-GtkCheckButton.html" title="GtkCheckButton">
<link rel="next" href="gtk3-GtkToggleButton.html" title="GtkToggleButton">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkCheckButton.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ButtonWidgets.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkToggleButton.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkRadioButton.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkRadioButton.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkRadioButton"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkRadioButton.top_of_page"></a>GtkRadioButton</span></h2>
<p>GtkRadioButton — A choice from multiple check buttons</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkRadioButton.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton">GtkRadioButton</a>;
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new" title="gtk_radio_button_new ()">gtk_radio_button_new</a>                (<em class="parameter"><code><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *group</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new-from-widget" title="gtk_radio_button_new_from_widget ()">gtk_radio_button_new_from_widget</a>    (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_group_member</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new-with-label" title="gtk_radio_button_new_with_label ()">gtk_radio_button_new_with_label</a>     (<em class="parameter"><code><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *group</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new-with-label-from-widget" title="gtk_radio_button_new_with_label_from_widget ()">gtk_radio_button_new_with_label_from_widget</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_group_member</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new-with-mnemonic" title="gtk_radio_button_new_with_mnemonic ()">gtk_radio_button_new_with_mnemonic</a>  (<em class="parameter"><code><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *group</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new-with-mnemonic-from-widget" title="gtk_radio_button_new_with_mnemonic_from_widget ()">gtk_radio_button_new_with_mnemonic_from_widget</a>
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_group_member</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-set-group" title="gtk_radio_button_set_group ()">gtk_radio_button_set_group</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *group</code></em>);
<a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-get-group" title="gtk_radio_button_get_group ()">gtk_radio_button_get_group</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_button</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-join-group" title="gtk_radio_button_join_group ()">gtk_radio_button_join_group</a>         (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_button</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *group_source</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkRadioButton.description"></a><h2>Description</h2>
<p>
A single radio button performs the same basic function as a <a class="link" href="gtk3-GtkCheckButton.html#GtkCheckButton" title="struct GtkCheckButton"><span class="type">GtkCheckButton</span></a>,
as its position in the object hierarchy reflects. It is only when multiple
radio buttons are grouped together that they become a different user
interface component in their own right.
</p>
<p>
Every radio button is a member of some group of radio buttons. When one is
selected, all other radio buttons in the same group are deselected. A
<a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> is one way of giving the user a choice from many options.
</p>
<p>
Radio button widgets are created with <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new" title="gtk_radio_button_new ()"><code class="function">gtk_radio_button_new()</code></a>, passing <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
as the argument if this is the first radio button in a group. In subsequent
calls, the group you wish to add this button to should be passed as an
argument. Optionally, <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new-with-label" title="gtk_radio_button_new_with_label ()"><code class="function">gtk_radio_button_new_with_label()</code></a> can be used if you
want a text label on the radio button.
</p>
<p>
Alternatively, when adding widgets to an existing group of radio buttons,
use <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new-from-widget" title="gtk_radio_button_new_from_widget ()"><code class="function">gtk_radio_button_new_from_widget()</code></a> with a <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> that already
has a group assigned to it. The convenience function
<a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new-with-label-from-widget" title="gtk_radio_button_new_with_label_from_widget ()"><code class="function">gtk_radio_button_new_with_label_from_widget()</code></a> is also provided.
</p>
<p>
To retrieve the group a <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> is assigned to, use
<a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-get-group" title="gtk_radio_button_get_group ()"><code class="function">gtk_radio_button_get_group()</code></a>.
</p>
<p>
To remove a <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> from one group and make it part of a new one,
use <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-set-group" title="gtk_radio_button_set_group ()"><code class="function">gtk_radio_button_set_group()</code></a>.
</p>
<p>
The group list does not need to be freed, as each <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> will remove
itself and its list item when it is destroyed.
</p>
<p>
</p>
<div class="example">
<a name="id3095009"></a><p class="title"><b>Example 51. How to create a group of two radio buttons.</b></p>
<div class="example-contents"><pre class="programlisting">
void create_radio_buttons (void) {

   GtkWidget *window, *radio1, *radio2, *box, *entry;
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   box = gtk_box_new (GTK_ORIENTATION_VERTICAL, TRUE, 2);

   /* Create a radio button with a GtkEntry widget */
   radio1 = gtk_radio_button_new (NULL);
   entry = gtk_entry_new ();
   gtk_container_add (GTK_CONTAINER (radio1), entry);


   /* Create a radio button with a label */
   radio2 = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio1),
                                                         "I'm the second radio button.");

   /* Pack them into a box, then show all the widgets */
   gtk_box_pack_start (GTK_BOX (box), radio1, TRUE, TRUE, 2);
   gtk_box_pack_start (GTK_BOX (box), radio2, TRUE, TRUE, 2);
   gtk_container_add (GTK_CONTAINER (window), box);
   gtk_widget_show_all (window);
   return;
}
</pre></div>
</div>
<p><br class="example-break">
</p>
<p>
When an unselected button in the group is clicked the clicked button
receives the <span class="type">"toggled"</span> signal, as does the previously
selected button.
Inside the <span class="type">"toggled"</span> handler, <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-get-active" title="gtk_toggle_button_get_active ()"><code class="function">gtk_toggle_button_get_active()</code></a>
can be used to determine if the button has been selected or deselected.
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkRadioButton.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkRadioButton"></a><h3>struct GtkRadioButton</h3>
<pre class="programlisting">struct GtkRadioButton {
  GtkCheckButton check_button;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-new"></a><h3>gtk_radio_button_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_radio_button_new                (<em class="parameter"><code><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *group</code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a>. To be of any practical value, a widget should
then be packed into the radio button.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
<td>an existing
radio button group, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if you are creating a new group. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkRadioButton][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new radio button</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-new-from-widget"></a><h3>gtk_radio_button_new_from_widget ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_radio_button_new_from_widget    (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_group_member</code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a>, adding it to the same group as
<em class="parameter"><code>radio_group_member</code></em>. As with <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-new" title="gtk_radio_button_new ()"><code class="function">gtk_radio_button_new()</code></a>, a widget
should be packed into the radio button.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>radio_group_member</code></em> :</span></p></td>
<td>an existing <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new radio button. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-new-with-label"></a><h3>gtk_radio_button_new_with_label ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_radio_button_new_with_label     (<em class="parameter"><code><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *group</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> with a text label.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
<td>an existing
radio button group, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if you are creating a new group. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkRadioButton][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>the text label to display next to the radio button.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new radio button.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-new-with-label-from-widget"></a><h3>gtk_radio_button_new_with_label_from_widget ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_radio_button_new_with_label_from_widget
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_group_member</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> with a text label, adding it to
the same group as <em class="parameter"><code>radio_group_member</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>radio_group_member</code></em> :</span></p></td>
<td>widget to get radio group from or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>a text string to display next to the radio button.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new radio button. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-new-with-mnemonic"></a><h3>gtk_radio_button_new_with_mnemonic ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_radio_button_new_with_mnemonic  (<em class="parameter"><code><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *group</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> containing a label, adding it to the same
group as <em class="parameter"><code>group</code></em>. The label will be created using
<a class="link" href="gtk3-GtkLabel.html#gtk-label-new-with-mnemonic" title="gtk_label_new_with_mnemonic ()"><code class="function">gtk_label_new_with_mnemonic()</code></a>, so underscores in <em class="parameter"><code>label</code></em> indicate the
mnemonic for the button.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
<td>the radio button
group. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkRadioButton][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>the text of the button, with an underscore in front of the
mnemonic character</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-new-with-mnemonic-from-widget"></a><h3>gtk_radio_button_new_with_mnemonic_from_widget ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_radio_button_new_with_mnemonic_from_widget
                                                        (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_group_member</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> containing a label. The label
will be created using <a class="link" href="gtk3-GtkLabel.html#gtk-label-new-with-mnemonic" title="gtk_label_new_with_mnemonic ()"><code class="function">gtk_label_new_with_mnemonic()</code></a>, so underscores
in <em class="parameter"><code>label</code></em> indicate the mnemonic for the button.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>radio_group_member</code></em> :</span></p></td>
<td>widget to get radio group from or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>the text of the button, with an underscore in front of the
mnemonic character</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-set-group"></a><h3>gtk_radio_button_set_group ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_radio_button_set_group          (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> *group</code></em>);</pre>
<p>
Sets a <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a>'s group. It should be noted that this does not change
the layout of your interface in any way, so if you are changing the group,
it is likely you will need to re-arrange the user interface to reflect these
changes.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>radio_button</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>group</code></em> :</span></p></td>
<td>an existing radio
button group, such as one returned from <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-get-group" title="gtk_radio_button_get_group ()"><code class="function">gtk_radio_button_get_group()</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkRadioButton]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-get-group"></a><h3>gtk_radio_button_get_group ()</h3>
<pre class="programlisting"><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            gtk_radio_button_get_group          (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_button</code></em>);</pre>
<p>
Retrieves the group assigned to a radio button.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>radio_button</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a linked list
containing all the radio buttons in the same group
as <em class="parameter"><code>radio_button</code></em>. The returned list is owned by the radio button
and must not be modified or freed. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkRadioButton][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-radio-button-join-group"></a><h3>gtk_radio_button_join_group ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_radio_button_join_group         (<em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *radio_button</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> *group_source</code></em>);</pre>
<p>
Joins a <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> object to the group of another <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> object
</p>
<p>
Use this in language bindings instead of the <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-get-group" title="gtk_radio_button_get_group ()"><code class="function">gtk_radio_button_get_group()</code></a> 
and <a class="link" href="gtk3-GtkRadioButton.html#gtk-radio-button-set-group" title="gtk_radio_button_set_group ()"><code class="function">gtk_radio_button_set_group()</code></a> methods
</p>
<p>
A common way to set up a group of radio buttons is the following:
</p>
<div class="informalexample"><pre class="programlisting">
  GtkRadioButton *radio_button;
  GtkRadioButton *last_button;

  while (/* more buttons to add */)
    {
       radio_button = gtk_radio_button_new (...);

       gtk_radio_button_join_group (radio_button, last_button);
       last_button = radio_button;
    }
</pre></div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>radio_button</code></em> :</span></p></td>
<td>the <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>group_source</code></em> :</span></p></td>
<td>a radio button object whos group we are
joining, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to remove the radio button from its group. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
</div>
<div class="refsect1">
<a name="gtk3-GtkRadioButton.see-also"></a><h2>See Also</h2>
<a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>